package TestModel;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedList;

import junit.framework.TestCase;
import DataModel.DesignRulesManager.*;

public class DesignRulesParserTest extends TestCase {

	private LinkedList<CDesignRule> m_drList;
	private CDesignRulesManager m_designMan;
	private CDesignRulesParser m_drParser;
	private Integer m_drcConst;
	
	public DesignRulesParserTest()
	{
		m_drList = new LinkedList<CDesignRule>();
		
		File file = new File("execution/DesignRules.txt");		
		URL fileURL = null;
		
		try 
		{
			fileURL = file.getAbsoluteFile().toURI().toURL();
		} 
		catch (MalformedURLException e) 
		{
			e.printStackTrace();
		}
		
		m_drParser = new CDesignRulesParser(fileURL,m_drList, m_drcConst);
		
		
	}

	public void testParse() 
	{
		m_drParser.Parse();
		
		for (CDesignRule designRule : m_drList) 
		{
			System.out.println(designRule.toString());
		}
		
	}
	
}
